import axios from '../axios';
import { ADMINS } from './consts.js';

export default {
    //管理员登录
    adminsLogin(data) {
        return axios({
            url: "/admins/login",
            method: 'post',
            data
        })
    },

    getAdmins(params) {
        return axios({
            url: ADMINS + '/getAdmins',
            method: 'get',
            params
        })
    },
    addAdmin(data) {
        return axios({
            url: ADMINS + '/addAdmin',
            method: 'post',
            data
        })
    },
    delAdmin(data) {
        return axios({
            url: ADMINS + '/delAdmin',
            method: "delete",
            data
        })
    },
    updateAdmin(data) {
        console.log('api', data);
        return axios({
            url: ADMINS + '/updateAdmin',
            method: "post",
            data
        })
    },
    getAdminById(data) {
        console.log('api111', data);
        return axios({
            url: ADMINS + '/getAdminById/:_id',
            method: "post",
            data
        })
    },
}
